package com.atguigu.daijia.customer.service;

import com.atguigu.daijia.model.form.customer.ExpectOrderForm;
import com.atguigu.daijia.model.form.customer.SubmitOrderForm;
import com.atguigu.daijia.model.form.map.CalculateDrivingLineForm;
import com.atguigu.daijia.model.form.payment.CreateWxPaymentForm;
import com.atguigu.daijia.model.vo.base.PageVo;
import com.atguigu.daijia.model.vo.customer.ExpectOrderVo;
import com.atguigu.daijia.model.vo.driver.DriverInfoVo;
import com.atguigu.daijia.model.vo.map.DrivingLineVo;
import com.atguigu.daijia.model.vo.map.OrderLocationVo;
import com.atguigu.daijia.model.vo.map.OrderServiceLastLocationVo;
import com.atguigu.daijia.model.vo.order.CurrentOrderInfoVo;
import com.atguigu.daijia.model.vo.order.OrderInfoVo;
import com.atguigu.daijia.model.vo.payment.WxPrepayVo;

public interface OrderService {

    /**
     * 预估订单数据
     * @param expectOrderForm
     * @return
     */
    ExpectOrderVo expectOrder(ExpectOrderForm expectOrderForm);

    /**
     * 乘客下单
     * @param submitOrderForm
     * @return
     */
    Long submitOrder(SubmitOrderForm submitOrderForm);

    /**
     * 查询订单状态
     * @param orderId
     * @return
     */
    Integer getOrderStatus(Long orderId);

    /**
     * 查询乘客执行中订单基本信息
     * @param customerId
     * @return
     */
    CurrentOrderInfoVo searchCustomerCurrentOrder(Long customerId);

    /**
     * 根据订单 ID 查询当前乘客的订单信息
     * @param orderId
     * @param customerId
     * @return
     */
    OrderInfoVo getOrderInfo(Long orderId, Long customerId);

    /**
     * 根据订单 ID 查询司机基本信息
     * @param orderId
     * @param customerId
     * @return
     */
    DriverInfoVo getDriverInfo(Long orderId, Long customerId);

    /**
     * 从缓存中获取接单司机前往代驾订单起始点过程中的位置信息
     * @param orderId
     * @return
     */
    OrderLocationVo getDriverLocationFromCache(Long orderId);

    /**
     * 计算接单司机前往代驾订单起始点的最佳路线
     * @param calculateDrivingLineForm
     * @return
     */
    DrivingLineVo calculateDriverRouteToOrderStartPoint(CalculateDrivingLineForm calculateDrivingLineForm);

    /**
     * 开始代驾服务后，定时获取订单服务期间司机的最新位置信息
     * @param orderId
     * @return
     */
    OrderServiceLastLocationVo getOrderServiceLastLocation(Long orderId);

    /**
     * 分页查询乘客订单列表
     * @param customerId
     * @param page
     * @param limit
     * @return
     */
    PageVo findCustomerOrderPage(Long customerId, Long page, Long limit);

    /**
     * 调用微信 JSAPI 下单接口，获取预支付交易会话标识
     * @param createWxPaymentForm
     * @return
     */
    WxPrepayVo createWxPayment(CreateWxPaymentForm createWxPaymentForm);

    /**
     * 查询订单支付状态
     * @param orderNo
     * @return
     */
    Boolean queryPayStatus(String orderNo);
}
